const app = {
    init: function () {
        this.getCaptcha()
        this.imgCache()
    },
    getCaptcha: function () {
        $.post("/admin/captcha?t=" + Math.random(), function (res) {
            $("#captchaId").val(res.captchaId)
            $("#captchaImg").attr("src", res.captchaImage)
        })
    },
    imgCache() {
        const that = this;
        $("#captchaImg").click(function () {
            that.getCaptcha()
        })
    }
};
$(function () {
    app.init()
})